<?php
header('application/json;charset=utf-8');
error_reporting(0);
$cookie=$_GET['cd'];
$host='localhost';
$user='root';
$password='Xiangni365';
$database='login';
$con=mysqli_connect($host,$user,$password,$database);
$encode=mysqli_query($con,"set names utf8");
$check=mysqli_fetch_array(mysqli_query($con,"SELECT nick_name FROM login_check WHERE current_cookie='$cookie'"));
$user=mysqli_fetch_array(mysqli_query($con,"SELECT user FROM login_check WHERE current_cookie='$cookie'"));
$url=mysqli_fetch_array(mysqli_query($con,"SELECT face_url FROM login_check WHERE current_cookie='$cookie'"));
$admin=mysqli_fetch_array(mysqli_query($con,"SELECT if_admin FROM login_check WHERE current_cookie='$cookie'"));
$result=json_encode(array('user'=>$user[0],'nickname'=>$check[0],'url'=>$url[0],'admin'=>$admin[0]));
if($check!=null){
    echo($result);
}else{
    echo('0');
}
?>